import request from '@/utils/request'

// 获取所有权限点
export function getPermission(){
    return request({
        url:'/sys/permission',
        method:'get'
    })
}

// 添加权限点
export function addPermission(data){
    return request({
        url:'/sys/permission',
        method:'post',
        data
    })
}

// 删除权限点
export function delPermission(id){
    return request({
        url:'/sys/permission/'+id,
        method:'delete',
    })
}

// 根据id获取权限详情
export function getPermissionDetail(id){
    return request({
        url:'/sys/permission/'+id,
        method:'get',
    })
}

// 根据id更新权限详情
export function savePermissionDetail(data){
    return request({
        url:'/sys/permission/'+data.id,
        method:'put',
        data
    })
}